﻿/*-------------------------------------------------------
 * Author : Tharinduni Udugamasuriya
 * Date : July 2014
 * IMasterWriteService : Interface of WriteService
 ------------------------------------------------------*/

using System.Data;
using System.Data.SqlClient;

namespace DSPL.Contracts.Interfaces
{
    public interface IWriteService
    {
        int PrimaryKey { get; set; }

        bool InsertMasterData(string tablename, string primaryKedField, DataRow newDataRow, ref SqlTransaction sqlTran);

        bool UpdateMasterData(string tableName, string primaryKedField,string logTableName, DataRow newDataRow, DataRow oldDataRow, ref SqlTransaction sqlTran);

        bool DeleteMasterData(string tableName,string primaryKedField, string logTableName, DataRow oldDataRow, ref SqlTransaction sqlTran);

        bool InsertTransactionData(string parentTableName, string childTableName, string primaryKedField, DataRow newDataRow, DataTable childDataTable, ref SqlTransaction sqlTran);

        bool UpdateTransactionData(string tableName, string primaryKedField, string logTableName, DataRow newDataRow, DataRow oldDataRow, ref SqlTransaction sqlTran);

        bool DeleteTransactionData(string tableName, string primaryKedField, string logTableName, DataRow oldDataRow, ref SqlTransaction sqlTran);

    }
}
